import { createStore, applyMiddleware, combineReducers } from 'redux';
import thunk from 'redux-thunk';

// 示例：用户状态reducer
const userReducer = (state = { isLogin: false }, action) => {
  switch (action.type) {
    case 'LOGIN_SUCCESS':
      return { ...state, isLogin: true };
    case 'LOGOUT':
      return { ...state, isLogin: false };
    default:
      return state;
  }
};

const rootReducer = combineReducers({ user: userReducer });
const store = createStore(rootReducer, applyMiddleware(thunk));

export default store;
export { userReducer };
